Integrand size = 39, antiderivative size = 189 \[ \int \sec ^2(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {(C (2+n)+A (3+n)) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-1-n),\frac {1-n}{2},\cos ^2(c+d x)\right ) (b \sec (c+d x))^{1+n} \sin (c+d x)}{b d (1+n) (3+n) \sqrt {\sin ^2(c+d x)}}+\frac {B \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-2-n),-\frac {n}{2},\cos ^2(c+d x)\right ) (b \sec (c+d x))^{2+n} \sin (c+d x)}{b^2 d (2+n) \sqrt {\sin ^2(c+d x)}}+\frac {C (b \sec (c+d x))^{2+n} \tan (c+d x)}{b^2 d (3+n)} \]
[Out]
Time = 0.24 (sec) , antiderivative size = 189, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.128, Rules used = {16, 4132, 3857, 2722, 4131} \[ \int \sec ^2(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {(A (n+3)+C (n+2)) \sin (c+d x) (b \sec (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-n-1),\frac {1-n}{2},\cos ^2(c+d x)\right )}{b d (n+1) (n+3) \sqrt {\sin ^2(c+d x)}}+\frac {B \sin (c+d x) (b \sec (c+d x))^{n+2} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-n-2),-\frac {n}{2},\cos ^2(c+d x)\right )}{b^2 d (n+2) \sqrt {\sin ^2(c+d x)}}+\frac {C \tan (c+d x) (b \sec (c+d x))^{n+2}}{b^2 d (n+3)} \]
[In]
[Out]
Rule 16
Rule 2722
Rule 3857
Rule 4131
Rule 4132
Rubi steps \begin{align*} \text {integral}& = \frac {\int (b \sec (c+d x))^{2+n} \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx}{b^2} \\ & = \frac {\int (b \sec (c+d x))^{2+n} \left (A+C \sec ^2(c+d x)\right ) \, dx}{b^2}+\frac {B \int (b \sec (c+d x))^{3+n} \, dx}{b^3} \\ & = \frac {C (b \sec (c+d x))^{2+n} \tan (c+d x)}{b^2 d (3+n)}+\frac {\left (A+\frac {C (2+n)}{3+n}\right ) \int (b \sec (c+d x))^{2+n} \, dx}{b^2}+\frac {\left (B \left (\frac {\cos (c+d x)}{b}\right )^n (b \sec (c+d x))^n\right ) \int \left (\frac {\cos (c+d x)}{b}\right )^{-3-n} \, dx}{b^3} \\ & = \frac {C (b \sec (c+d x))^{2+n} \tan (c+d x)}{b^2 d (3+n)}+\frac {B \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-2-n),-\frac {n}{2},\cos ^2(c+d x)\right ) \sec (c+d x) (b \sec (c+d x))^n \tan (c+d x)}{d (2+n) \sqrt {\sin ^2(c+d x)}}+\frac {\left (\left (A+\frac {C (2+n)}{3+n}\right ) \left (\frac {\cos (c+d x)}{b}\right )^n (b \sec (c+d x))^n\right ) \int \left (\frac {\cos (c+d x)}{b}\right )^{-2-n} \, dx}{b^2} \\ & = \frac {\left (A+\frac {C (2+n)}{3+n}\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-1-n),\frac {1-n}{2},\cos ^2(c+d x)\right ) (b \sec (c+d x))^{1+n} \sin (c+d x)}{b d (1+n) \sqrt {\sin ^2(c+d x)}}+\frac {C (b \sec (c+d x))^{2+n} \tan (c+d x)}{b^2 d (3+n)}+\frac {B \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-2-n),-\frac {n}{2},\cos ^2(c+d x)\right ) \sec (c+d x) (b \sec (c+d x))^n \tan (c+d x)}{d (2+n) \sqrt {\sin ^2(c+d x)}} \\ \end{align*}
Time = 1.99 (sec) , antiderivative size = 173, normalized size of antiderivative = 0.92 \[ \int \sec ^2(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\csc (c+d x) \sec (c+d x) (b \sec (c+d x))^n \left (A \left (12+7 n+n^2\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2+n}{2},\frac {4+n}{2},\sec ^2(c+d x)\right )+(2+n) \left (B (4+n) \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3+n}{2},\frac {5+n}{2},\sec ^2(c+d x)\right )+C (3+n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {4+n}{2},\frac {6+n}{2},\sec ^2(c+d x)\right )\right ) \sec ^2(c+d x)\right ) \sqrt {-\tan ^2(c+d x)}}{d (2+n) (3+n) (4+n)} \]
[In]
[Out]
\[\int \sec \left (d x +c \right )^{2} \left (b \sec \left (d x +c \right )\right )^{n} \left (A +B \sec \left (d x +c \right )+C \sec \left (d x +c \right )^{2}\right )d x\]
[In]
[Out]
\[ \int \sec ^2(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{n} \sec \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
\[ \int \sec ^2(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \left (b \sec {\left (c + d x \right )}\right )^{n} \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \sec ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
\[ \int \sec ^2(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{n} \sec \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
\[ \int \sec ^2(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{n} \sec \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \sec ^2(c+d x) (b \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \frac {{\left (\frac {b}{\cos \left (c+d\,x\right )}\right )}^n\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )}{{\cos \left (c+d\,x\right )}^2} \,d x \]
[In]
[Out]